# readme 面向对象编程

# 创建和使用类

'''
    class
        属性列表
        方法列表
'''


# self代表的实例本身，类似于java的this，可以改成a或者b，建议使用self
class Animal():
    # 构造方法
    def __init__(self, name, types, shouts):
        print("构造方法被调用。")
        self.name = name
        self.types = types
        self.shouts = shouts

    # 叫
    def shout(self):
        print("%s，%s，%s" % (self.types, self.name, self.shouts))


dog1 = Animal("小黑", "dog", "旺旺叫")
dog1.shout()
dog2 = Animal("小猫", "cat", "喵喵叫")
dog2.shout()
